package behaviorpattern.obsever.demo2;

import java.util.ArrayList;
import java.util.List;

public abstract class Subject {
	private String subjectState;
	protected List<Observer> observers = new ArrayList<Observer>();
	
	public Subject() {
//		observers = new ArrayList<Observer>();
	}
	
	public void attackObserver(Observer o) {
		observers.add(o);
	}
	
	public void deattackObserver(Observer o) {
		observers.remove(o);
	}
	
	public abstract void nofityObservers();
	
	public String getSubjectState() {
		return subjectState;
	}
	
	public void setSubjectState(String subjectState) {
		this.subjectState = subjectState;
	}
}
